package net.oschina.app.view;


import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager.LayoutParams;
import android.widget.ImageView;
import android.widget.TextView;

import net.oschina.app.R;

public class MyDiaLog extends Dialog implements View.OnClickListener{

	public MyDiaLog(Context context) {
		super(context, R.style.AddressStyle);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.dialog_style);
		TextView tvText = (TextView) findViewById(R.id.tv_dialog_text);
		TextView tvAlbum = (TextView) findViewById(R.id.tv_dialog_album);
		TextView tvPhoto = (TextView) findViewById(R.id.tv_dialog_photo);
		ImageView iv = (ImageView) findViewById(R.id.iv_dialog);
		tvText.setOnClickListener(this);
		tvAlbum.setOnClickListener(this);
		tvPhoto.setOnClickListener(this);
		iv.setOnClickListener(this);
		Window window = getWindow();
		LayoutParams params = window.getAttributes();
		params.gravity = Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
			case R.id.tv_dialog_text:
				doText();
				dismiss();
				break;
			case R.id.tv_dialog_album:
				doAlbum();
				dismiss();
				break;
			case R.id.tv_dialog_photo:
				doPhoto();
				dismiss();
				break;
			case R.id.iv_dialog:
				dismiss();
				break;
		}
	}

	public void doPhoto() {

	}

	public void doAlbum() {

	}

	public void doText() {

	}
}
